<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>公司列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/new_layui/css/layui.css" media="all">
    <style>
        /*子页面样式*/
        .childrenBody{ margin:10px 10px 0; }
        .layui-table td, .layui-table th{ word-break:break-all; }
        ::selection{background:#ff5722; color:#fff;} /*文字选中背景色*/
    </style>
</head>
<body class="childrenBody">
    <blockquote class="layui-elem-quote news_search">
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input type="text" value="" placeholder="请输入关键字" class="layui-input search_input">
            </div>
            <a class="layui-btn search_btn">查询</a>
        </div>
        <div class="layui-inline">
            <a class="layui-btn layui-btn-normal newsAdd_btn">注册资本</a>
        </div>
        <div class="layui-inline">
            <a class="layui-btn audit_btn">公司</a>
        </div>
    </blockquote>
    <table id="companyList" lay-filter="test"></table>

    <script src="/new_layui/layui.js"></script>
    <script>
        layui.use(['table','jquery'], function(){
            var table = layui.table, $=layui.jquery;
            //第一个实例
            table.render({
                elem: '#companyList'
                ,height: 500
                ,url: '/php/public/api/lagou/companyList.html' //数据接口
                ,page: true //开启分页
                ,cols: [[ //表头
                    {field: 'id', title: 'ID', width:50, sort: true, fixed: 'left'}
                    ,{field: 'name', title: '名称', width:150, templet: '#companyRowTpl'}
                    ,{field: 'total_name', title: '公司全称', width:250}
                    ,{field: 'type', title: '类别', width:150, sort: true}
                    ,{field: 'size', title: '规模', width:150}
                    ,{field: 'finance', title: '融资', width: 120, sort: true}
                    ,{field: 'update_at', title: '更新时间', width: 180, sort: true}
                   // ,{field: 'company_url', title: 'Boss直聘URL', width: 135}
                ]]
                ,done: function () {
                    $('.company_name').on('click',function () {
                        window.parent.addTab($(this));
                    });
                }
            });

        });
    </script>
    <script type="text/html" id="companyRowTpl">
        <a href="javascript:void(0)" style="color: #ff6662;" title="点击查看{{d.name}}详情" data-url="page/lagou/singleCompany.html?id={{d.lagou_id}}" class="company_name">
            <i class="layui-icon" data-icon=""></i>
            <cite>{{d.name}}</cite>
        </a>
    </script>
    <script type="text/javascript" src="/js/haha.js"></script>
</body>
</html>